#include "bdd.h"

char therr[201];

char *
td_error (uint nid, char *lang)
{
  FILE *f;
  int w = 0;
  char tmp[12] = "tderror_";
  if (strlen (lang) > 2 || nid < 2)
    return NULL;

  strcat (tmp, lang);

  f = fopen (tmp, "r");
  if (!f)
    return NULL;

  while (1)
    {
      fgets (therr, 200, f);
      if (feof (f))
	break;

      if (w++ == nid)
	{
	  fclose (f);
	  return (therr);
	}
    }
  fclose (f);

  return NULL;
}
